import request from "@/utils/request";
// 添加列表
export const getUserListApi = (username, status, email, page, limit) => {
  return request({
    url: `/permission/user?username=${username}&status=${status}&email=${email}&page=${page}&limit=${limit}`,
  });
};
// 上传图片接口
export const uploadImg = (data) => {
  return request({
    url: "/index/upload?mode=single&type=image",
    method: "post",
    data,
  });
};

// 添加接口
export const addUserListApi = (data) => {
  return request({
    url: "/permission/user",
    method: "post",
    data,
  });
};

// 添加接口
export const getUserCheckListApi = (data) => {
  return request({
    url: "/permission/role",
    data,
  });
};
// 回显接口
export const showUserCheckListApi = (id) => {
  return request({
    url: "/permission/user/" + id,
  });
};
// 回显接口
export const setUserListApi = (data) => {
  return request({
    url: "/permission/user/" + data.id,
    method: "PUT",
    data,
  });
};
// 删除接口
export const delUserListApi = (id) => {
  return request({
    url: "/permission/user/" + id,
    method: "DELETE",
  });
};
// 切换状态接口
export const cutStatusApi = (id, status) => {
  return request({
    url: "/permission/user/" + id + "/" + status,
  });
};
